/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package hearts;

/**
 *
 * @author TAI
 */

public class card {
	private int ID;
	private int chat;//Chat cua bai la co , ro , chuon , bi . Neu chat = 0 la co
	private int so;//So cua bai , ta chi quan tam den cac la bai co chat la co

	public card(int id){
		if ((id>0)&&(id<53)) ID=id;
		else ID=0;
		so=ID/4+1;
		chat=ID%4;
	}

	public int getID(){
		return ID;
	}

	public int getChat(){
		return chat;
	}

	public boolean kiemTraChatCo(){
		return (chat==0);
	}

	public boolean kiemTraCungChat(card othercard){
		return (othercard.chat==chat);
	}

        //Ham so sanh gia tri lon hon cua 1 la bai co cung chat co
	public boolean lonHon(card otherCard){
		return ((so>otherCard.so)&&(chat==otherCard.chat));
	}

}

